﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Deployment">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Solutions" type="SolutionCollection" minOccurs="0" maxOccurs="1" />
        <xs:element name="CentralAdmin" type="CentralAdmin" minOccurs="0" maxOccurs="1" />
        <xs:element name="WebApplications" type="WebApplicationCollection" minOccurs="0" maxOccurs="1" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="FeatureActivation">
    <xs:attribute name="Guid" type="xs:string" use="required" />
    <xs:attribute name="Description" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="FeatureCollection">
    <xs:sequence>
      <xs:element name="FeatureActivation" type="FeatureActivation" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SolutionDeployment">
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="GlobalInstallWPPackDlls" type="xs:boolean" default="true" />
  </xs:complexType>
  <xs:complexType name="SolutionDeploymentCollection">
    <xs:sequence>
      <xs:element name="SolutionDeployment" type="SolutionDeployment" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Web">
    <xs:sequence>
      <xs:element name="Features" type="FeatureCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Webs" type="WebCollection" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="Action" type="Action" use="optional" default="Lookup" />
    <xs:attribute name="Guid" type="xs:string" />
    <xs:attribute name="Url" type="xs:string" use="optional" default="" />
    <xs:attribute name="Title" type="xs:string" use="optional" default="" />
    <xs:attribute name="LCID" type="xs:int" use="optional" default="1033" />
    <xs:attribute name="Template" type="xs:string" use="optional" default="" />
    <xs:attribute name="UniquePermissions" type="xs:boolean" use="optional" default="false" />
    <xs:attribute name="Description" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="WebCollection">
    <xs:sequence>
      <xs:element name="Web" type="Web" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="RootWeb">
    <xs:complexContent>
      <xs:restriction base="Web">
        <xs:sequence>
          <xs:element name="Features" type="FeatureCollection" minOccurs="0" maxOccurs="1"/>
          <xs:element name="Webs" type="WebCollection" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="Action" type="Action" use="prohibited" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Site">
    <xs:sequence>
      <xs:element name="Features" type="FeatureCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="RootWeb" type="RootWeb" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="Action" type="Action" use="required" />
    <xs:attribute name="Title" type="xs:string" />
    <xs:attribute name="Guid" type="xs:string" />
    <xs:attribute name="Template" type="xs:string" />
    <xs:attribute name="LCID" type="xs:int" default="1033"/>
    <xs:attribute name="OwnerLogin" type="xs:string" />
    <xs:attribute name="Description" type="xs:string" default="" />
    <xs:attribute name="Url" type="xs:string" default="/" />
    <xs:attribute name="SecondaryOwnerLogin" type="xs:string" />
  </xs:complexType>
  <xs:simpleType name="ZoneType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Intranet"/>
      <xs:enumeration value="Extranet"/>
      <xs:enumeration value="Internet"/>
      <xs:enumeration value="Custom"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="AuthenticationMode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Windows"/>
      <xs:enumeration value="Forms"/>
      <xs:enumeration value="None"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="WebApplicationExtension">
    <xs:attribute name="Action" type="Action" use="required" />
    <xs:attribute name="Zone" type="ZoneType" use="required" />
    <xs:attribute name="Name" type="xs:string" />
    <xs:attribute name="Header" type="xs:string" />
    <xs:attribute name="RoleManager" type="xs:string" />
    <xs:attribute name="MembershipProvider" type="xs:string" />
    <xs:attribute name="AuthenticationMode" type="AuthenticationMode" default="Windows" />
    <xs:attribute name="Port" type="xs:int" />
    <xs:attribute name="SSLPort" type="xs:int" />
    <xs:attribute name="AllowAnonymous" type="xs:boolean" default="false" />
    <xs:attribute name="ClientIntegration" type="xs:boolean" default="true" />
    <xs:attribute name="UseSSL" type="xs:boolean" default="false" />
    <xs:attribute name="UseNTLM" type="xs:boolean" default="true" />
  </xs:complexType>
  <xs:complexType name="WebApplicationExtensionCollection">
    <xs:sequence>
      <xs:element name="WebApplicationExtension" type="WebApplicationExtension" minOccurs="0" maxOccurs="5"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SiteCollection">
    <xs:sequence>
      <xs:element name="Site" type="Site" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Field">
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="Value" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="FieldCollection">
    <xs:sequence>
      <xs:element name="Field" type="Field" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ListItem">
    <xs:all>
      <xs:element name="Fields" type="FieldCollection" minOccurs="0" maxOccurs="1"/>
    </xs:all>
    <xs:attribute name="ContentType" type="xs:string" use="required" />
  </xs:complexType>
  <xs:complexType name="ListFolder">
    <xs:sequence>
      <xs:element name="Folder" type="ListFolder" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="ListItem" type="ListItem" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ListCollection">
    <xs:sequence>
      <xs:element name="List" type="ListFolder" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Solution">
    <xs:attribute name="FileName" type="xs:string" use="required" />
    <xs:attribute name="DeployGlobally" type="xs:boolean" default="false" />
  </xs:complexType>
  <xs:complexType name="SolutionCollection">
    <xs:sequence>
      <xs:element name="Solution" type="Solution" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="Action">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Create"/>
      <xs:enumeration value="Lookup"/>
      <xs:enumeration value="LookupOrCreate"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CentralAdmin">
    <xs:all>
      <xs:element name="Features" type="FeatureCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="SolutionDeployments" type="SolutionDeploymentCollection" minOccurs="0" maxOccurs="1"/>
    </xs:all>
  </xs:complexType>
  <xs:complexType name="WebApplication">
    <xs:sequence>
      <xs:element name="WebApplicationExtensions" type="WebApplicationExtensionCollection" minOccurs="0" maxOccurs="1">
        <xs:unique name="WebApplicationExtensionForEachZone">
          <xs:selector xpath="WebApplicationExtension"/>
          <xs:field xpath="@Zone"/>
        </xs:unique>
      </xs:element>
      <xs:element name="SolutionDeployments" type="SolutionDeploymentCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Features" type="FeatureCollection" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Sites" type="SiteCollection" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="Action" type="Action" use="required" />
    <xs:attribute name="Name" type="xs:string" />
    <xs:attribute name="Guid" type="xs:string" />
    <xs:attribute name="Port" type="xs:int" />
    <xs:attribute name="PoolName" type="xs:string" />
    <xs:attribute name="Header" type="xs:string" />
    <xs:attribute name="Database" type="xs:string" />
    <xs:attribute name="AllowAnonymous" type="xs:boolean" default="false" />
    <xs:attribute name="UseSSL" type="xs:boolean" default="false" />
    <xs:attribute name="UseNTLM" type="xs:boolean" default="true" />
    <xs:attribute name="DatabaseServer" type="xs:string" />
    <xs:attribute name="DatabaseUser" type="xs:string" />
    <xs:attribute name="DatabasePassword" type="xs:string" />
    <xs:attribute name="CreatePool" type="xs:boolean" default="true" />
    <xs:attribute name="PoolUser" type="xs:string" />
    <xs:attribute name="PoolPassword" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="WebApplicationCollection">
    <xs:sequence>
      <xs:element name="WebApplication" type="WebApplication" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>